package dao;

import entity.News;

public interface NewsDao {
    public void save(News news);


    public static NewsDao getInstance(String key) {
        switch (key) {
            case "mysql":
                return new NewDaoMySqlImpl();
            case "oracle":
                return new NewsDaoOrackekImpl();
            case "redis":
                return new NewsDaoRedisImpl();
            default:
                throw new RuntimeException("无效的数据库类型：" + key + ",dao获取失败");
        }

    }
}
